package com.bw.user;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @ClassName SingleObject
 * @Author Hao_YunKai
 * @Date 2022/3/7 14:21
 */
public class SingleObject {
    // 饿汉式 进来就创建对象
    private static final SingleObject instance = new SingleObject();

    private SingleObject() {}

    private synchronized static SingleObject getInstance() {
        return instance;
    }

    public static void main(String[] args) {

    }
}